<template>
  <div class="container">
    <van-tabs v-model="active">
      <van-tab title="榜样先锋">
        <div class="list">
          <div v-for="item in list" :key="item.id" class="item">
            <img class="img" :src="item.image|imgPath" alt>
            <div class="info">
              <div class="name">{{item.realname}}</div>
              <div class="extra">{{item.createTime||"2018-04-13 15:21:26"}}</div>
            </div>
            <router-link :to="`/party-member/detail/${item.id}`">
              <van-button class="btn" type="danger">查看详情</van-button>
            </router-link>
          </div>
        </div>
      </van-tab>
      <van-tab title="党员风采">
        <article-list id="053551262afe4085b04c2f8d9ce06d60"></article-list>
      </van-tab>
    </van-tabs>
  </div>
</template>
<script>
import articleList from '@/components/article-list'

export default {
  components: {
    articleList
  },
  data () {
    return {
      active: 0,
      list: []
    }
  },
  created () {
    this.getList()
  },
  methods: {
    getList () {
      this.$axios.get('/xbkj-dj/web/showuser/list').then(res => {
        this.list = res.data
      })
    }
  }
}
</script>
<style lang="less" scoped>
.list {
  background-color: #fff;
  border-radius: 4px;
  .item {
    display: flex;
    align-items: center;
    padding: 20px;
    .img {
      flex: 0 0 45px;
      display: block;
      width: 45px;
      height: 60px;
      margin-right: 10px;
      border-radius: 4px;
    }
    .info {
      flex: 1;
      display: flex;
      height: 50px;
      flex-direction: column;
      justify-content: space-between;
      .name {
        font-weight: bold;
      }
      .extra {
        font-size: 12px;
        color: #999;
      }
    }
    .btn {
      height: 30px;
      line-height: 30px;
      border-radius: 4px;
    }
  }
}
</style>
